package javbot.command;

import java.awt.AWTException;

public class CmdWait extends Command {

	final private int seconds;
	private int times;
	private int remainder;
	
	public CmdWait(int seconds) throws AWTException {
		super();
		this.seconds = seconds;
		this.times = seconds / 60;
		this.remainder = seconds % 60;		
	}

	public void execute(){
		while (times > 0) {
			robot.delay(60000);
			times--;
		} 
		
		try {
			Thread.sleep(remainder * 1000);
		} catch (InterruptedException e) {
		}
	}

	public String toString() {
		return "Wait " + seconds + " seconds";
	}


}
